<?php
namespace app\api\controller\waimai;

use app\common\controller\ApiController;
use app\api\service\DeliveryService;
use think\exception\ValidateException;
use think\facade\Request;
use app\api\model\Shop;

// 基础数据
class BasicData extends ApiController
{

    // 查询配送城市
    public function openCitiesLists()
    {
        //     $data['third_number']=99;
        //     $data['app_type']=1;
        //     $data['appoint_type']=1;

        //    $res=(new Shop)->getShopsType('shansong_dev');
        //    var_dump($res);exit;

        $params = Request::post();

        // 处理逻辑
        $service = new DeliveryService($this->app_type);
        $result = $service->openCitiesLists($params);
         if($result["success"]){
             output_success('success', $result['data']);
         }else{
             output_error($result["msg"]);
         }

    }
    

    // 查询城市可指定的交通工具
    public function optionalTravelWay()
    {
        $params = Request::post();

        // 处理逻辑
        $service = new DeliveryService($this->app_type);
        $result = $service->optionalTravelWay($params);

        if($result["success"]){
            output_success('success', $result['data']);
        }else{
            output_error($result["msg"]);
        }
    }

    //查询账号额度
    public function getUserAccount()
    {
        $params = Request::post();

        // 处理逻辑
        $service = new DeliveryService($this->app_type);
        $result = $service->getUserAccount($params);

        if($result["success"]){
            output_success('success', $result['data']);
        }else{
            output_error($result["msg"]);
        }
    }
}